<!DOCTYPE html>
<html>
<head>
    <!--[if lt IE 7]>
    <div class="ie6_error">还在用<strong>漏洞百出的IE6浏览器</strong>么？为了您的网络安全，请升级浏览器 <a target="_blank"
                                                                               href="http://browsehappy.com">立即升级</a>
    </div>
    <![endif]-->

    <meta charset="utf-8">
    <title>订单管理-审批订单-文具1号</title>
    <meta name="description"
          content="文具1号作为上海办公用品供货商公司,专为世界500强企业及SOHO办公族提供网上商城一站式办公耗材批发及采购服务,一站式选购办公日用文具用品,厂家直销,好货又便宜【阳光采购就上文具1号 阳光价格 老板放心 品质保障 员工省力】"/>
    <meta name="keywords" content="办公用品,办公文具,办公文具网站,文具网站,办公用品网,文具采购网,金万年"/>
    <meta name="copyright" content="上海易推信息科技有限公司"/>
    <meta name="renderer" content="webkit">
    <base href="<?php echo base_url(); ?>"/>
    <link rel="shortcut icon" href="favicon.ico"/>
    <link rel="stylesheet" href="public/js/layui/css/layui.css">
    <link rel="stylesheet" type="text/css" href="public/css/base.css"/>
    <link rel="stylesheet" type="text/css" href="public/css/common.css"/>
    <link rel="stylesheet" type="text/css" href="public/css/index.css"/>
    <link rel="stylesheet" type="text/css" href="public/css/index.css"/>
    <link rel="stylesheet" type="text/css" href="public/css/list_bought.css"/>
    <link rel="stylesheet" type="text/css" href="public/css/order-manage.css"/>
    <!--[if lte IE 9]>
    <script type="text/javascript" src="public/js/html5shiv-printshiv-3.js"></script>
    <![endif]-->
</head>
<body>
<div class="bg">
    <!--common - head -->
    <?php $this->load->view('common/header.php'); ?>

    <!--common - head end-->

    <div class="container mt20">
        <div class="order-manage-container">
            <p class="path-tit">
                <em class="color-red">订单管理</em>＞审批订单
            </p>
            <div class="order-manage-cont">
                <div id="main-content">

                    <div class="bought-list">
                        <form class="skin-gray clearfix bought-search" action="<?php echo base_url();?>order/approve_order" method="get">
                            <!--bought-search-more -->
                            <div class="remide-box" gdata-spm="7">
                                <h3>我的审批提醒：</h3>
                                <ul>
                                    <li><a href="<?php echo base_url()?>order/approve_order?id=6" <?php if ($id == 6): ?>class="select"<?php endif; ?>>审批中<span class="num">(<?=$count_zhong?>)</span></a></li>
                                    <li><a href="<?php echo base_url()?>order/approve_order?id=1" <?php if ($id == 1): ?>class="select"<?php endif; ?>>审批通过<span class="num">(<?=$count_tongguo?>)</span></a></li>
                                    <li><a href="<?php echo base_url()?>order/approve_order?id=7" <?php if ($id == 7): ?>class="select"<?php endif; ?>>审批未通过<span class="num">(<?=$count_weitongguo?>)</span></a></li>
                                </ul>
                                <button class="J_MakePoint button search-btn" type="submit" id="searchBtn">
                                    搜索
                                </button>
                                <input type="text" size="50" id="J_BaobeiName" name="order_bn" value="<?= $order_bn ?>" placeholder="搜索订单号" maxlength="30">
                            </div>

                        </form>
                        <form name="combinPay" gdata-mergeurl="bBPayment-mergeOrders.html" method="post" target="_blank">
                        </form>
                        <form action="" method="post" id="J_BoughtListForm">
                            <input id="J_Token" type="hidden" name="_tb_token_" value="gUF4t3NQyTm">
                            <div class="navfloat" style="position:relative">
                            </div>
                            <table class="bought-table" id="J_BoughtTable">
                                <colgroup>
                                    <col class="selector">
                                    <col class="baobei">
                                    <col class="price">
                                    <col class="price">
                                    <col class="price">
                                    <col class="quantity">
                                    <col class="price">
                                    <col class="after-service">

                                    <col class="trade-status">
                                    <col class="operate">
                                </colgroup>
                                <thead id="list-table-th" class="list-table-th">
                                <tr class="col-name">
                                    <th></th>
                                    <th class="baobei" style="text-align: left">商品信息</th>
                                    <th class="price">单价(元)</th>
                                    <th class="quantity">优惠</th>
                                    <th class="price">现价</th>
                                    <th class="price">数量</th>
                                    <th class="quantity">实付款</th>
                                    <th class="submit-time"></th>
                                    <th class="after-service">原由</th>
                                    <th class="remark" colspan="2">审批状态</th>
                                </tr>
                                <?php if($list):?>
                                <tr class="toolbar ">
                                    <td colspan="8">
                                    </td>
                                    <td class="last-col" colspan="3">
                                        <?php if($p > 1):?>
                                        <div class="paginator-top">
                                            <div class="paginator-next paginator-prev g-u preurl">上一页<span class="paginator-arrow paginator-arrow-right-grey"></span></div>
                                            <?php endif;?>
                                            <?php if($p < $num):?>
                                            <div class="paginator-next g-u nexturl">下一页<span class="paginator-arrow paginator-arrow-right-grey"></span></div>
                                            <?php endif;?>
                                        </div>
                                    </td>
                                </tr>
                                <?php endif;?>
                                </thead>
                                <?php if($list):?>
                                <tbody gdata-isarchive="false" gdata-orderid="6646" gdata-status="WAIT_BUYER_PAY" class="xcard">
                                <?php foreach ($list as $vo): ?>
                                <tr class="order-hd">
                                    <td colspan="11">
                                        <span class="no">
                                            <label>
                                              <input type="checkbox" class="J_Selector selector"  name="order_id" value="6646" gdata-mergetype="none">
                                              <span class="g-u"> </span>
                                              <?php if($vo['shop_order_bn']):?>
                                              订单编号：<span class="order-num"><?=$vo['shop_order_bn']?></span>
                                          <?php endif;?>
                                            </label>
                                        </span>
                                        <span class="deal-time">创建时间：<?=$vo['created_at']?></span>
                                        <span class="seller">
                                            <a target="_blank" class="nickname J_MakePoint" title="文具1号超市" href="<?php echo base_url('office'); ?>">文具1号超市</a>
                                        </span>
                                        <a href="javascript:;" class="modify-order" val="<?=$vo['id']?>">
                                            修改订单＞
                                        </a>
                                    </td>
                                </tr>
                                <?php if($vo['detail']['products']):?>
                                <?php foreach ($vo['detail']['products'] as $key => $bo): ?>
                                <tr class="order-bd last" data-gid="10518" data-gcount="1">
                                    <td class="baobei" colspan="2">
                                        <a target="_blank" hidefocus="true" title="查看商品详情" href="<?php echo base_url()?>goods/detail?id=<?=$bo['product_id']?>" class="pic s50">
                                            <img alt="查看商品详情" src="<?= $bo['product_img'] ?>">
                                        </a>

                                        <div class="desc">
                                            <a class="baobei-name" target="_blank" href="<?php echo base_url()?>goods/detail?id=<?=$bo['product_id']?>">
                                                <?= $bo['product_name'] ?> </a>
                                            <div class="spec" title="">
                                                <?php foreach ($bo['sku_info'] as $k => $v): ?>
                                                    <span><?= $k ?> : <?= $v ?>&nbsp;&nbsp;</span>
                                                <?php endforeach; ?>
                                            </div>
                                        </div>
                                    </td>
                                    <td class="price oprice" title=""><?= $bo['price'] ?></td>
                                    <td class="quantity" title=""><?= ($bo['price']-$bo['final_price'])*$bo['count'] ?></td>
                                    <td class="price" title="" ><?= $bo['final_price'] ?></td>
                                    <td class="price" title=""><?= $bo['count'] ?></td>
                                    <?php if ($key == 0): ?>
                                    <td class="quantity" title="" rowspan="<?= count($vo['detail']['products']) ?>"><?= $vo['money'] ?> <br><em class="color-gray">（含快递<?= $vo['express_fee'] ?>）</em></td>
                                    <td class="pro-box" rowspan="<?= count($vo['detail']['products']) ?>">
                                    </td>
                                    <td class="trade-status" rowspan="<?= count($vo['detail']['products']) ?>">
                                        <span class="J_MakePoint status closed" target="_blank" ><?= $vo['reason'] ?></span>
                                      <span>
                                            <a href='<?php echo base_url()?>order/approve?id=<?=$vo['id']?>' target="_blank" class="detail-link J_MakePoint color-blue">查看订单详情</a>
                                      </span>
                                    </td>
                                    <td class="other" style="text-align: left" rowspan="<?= count($vo['detail']['products']) ?>" colspan="2">
                                        <?php if($vo['status'] == 1):?>
                                            <em class="color-gray"> <?=$vo['update_at']?></em><br><em class="color-red">审核通过</em><br>
                                            <?php if($vo['shop_status'] == 4):?>
                                            <a style="float: left;" class="confirm-receipt " target="_blank" href="<?=$this->config->item("shop_url").'bBPayment-mergeOrders.html&orderId='.$vo['shop_order_id']?>">去付款</a>
                                            <?php endif;?>
                                        <?php elseif($vo['status'] == 0):?>
                                            <em class="color-gray"> <?=$vo['update_at']?></em><br><em class="color-red">已取消</em><br>
                                        <?php elseif($vo['status'] == 2):?>
                                            <em class="color-gray"> <?=$vo['update_at']?></em><br><em class="color-red">Manager审核中</em><br>

                                        <?php elseif($vo['status'] == 3):?>
                                            <em class="color-gray"> <?=$vo['update_at']?></em><br><em class="color-red">Manager驳回</em><br>
                                            <?php foreach ($vo['temp_approval'] as $val):?>
                                                <?php if($val['identity'] == 2):?>
                                                    <span class="tal">原因：<?=$val['reason']?></span>
                                                <?php endif;?>
                                            <?php endforeach;?>
                                        <?php elseif($vo['status'] == 4):?>
                                            <em class="color-gray"> <?=$vo['update_at']?></em><br><em class="color-red">Admin审批中</em>
                                        <?php elseif($vo['status'] == 5):?>
                                            <em class="color-gray"> <?=$vo['update_at']?></em><br><em class="color-red">Admin驳回</em><br>
                                            <?php foreach ($vo['temp_approval'] as $val):?>
                                                <?php if($val['identity'] == 1):?>
                                                    <span class="tal">原因：<?=$val['reason']?></span>
                                                <?php endif;?>
                                            <?php endforeach;?>
                                        <?php endif;?>



                                    </td>
                                    <?php endif; ?>
                                </tr>
                                <?php endforeach; ?>
                                <?php endif; ?>
                                <?php endforeach; ?>
                                </tbody>


                                </tbody>

                                <tfoot>
                                <tr class="sep-row">
                                    <td colspan="8"></td>
                                </tr>
                                <tr class="toolbar skin-gray">
                                    <td colspan="3">
                                    </td>

                                    <td class="page-nav-cell" colspan="8">
                                        <div id="demo7" style="text-align: right"></div>
                                    </td>
                                </tr>
                                </tfoot>
                                <?php else:?>
                                    <tbody style="border: none;">
                                        <tr>
                                            <td colspan="11" style="text-align: center;font-size: 15px;color: grey;border: none;height: 250px;line-height: 250px;">
                                                暂无审批订单
                                            </td>
                                        </tr>
                                    </tbody>
                                
                                <?php endif;?>
                            </table>
                        </form>
                    </div>
                    <!--end bought-list-->
                </div>

            </div>
        </div>
    </div>
    <?php $this->load->view('common/bottom.php'); ?>
</div>
<div class="block" style="display:none;">
<div class="mask"></div>
<div class="pop pop-account-activation bg-padding-inside" style="height: 283px">
    <a href="javascript:;" class="close bg-btn_close_n"></a>
    <p class="top-tit">
        <span class="bg-logo_popup"></span>
    </p>
    <div class="cont">
        <p class="intro">
            审批通知已成功发送至您的上级账户及邮箱。
        </p>
        <p class="name pt10">账户：<em class="color-black">manager_001</em></p>
        <p class="name">邮箱：<em class="color-black">whityyi@supergk.com</em></p>
        <div class="btn-box">
            <button class="adjustment-budget-submit">确 定</button>
        </div>
    </div>
</div>
</div>
    <!--冻结账户-->
<script type="text/javascript" src="public/js/jquery.min.js"></script>
<script type="text/javascript" src="public/js/index.js"></script>
<script type="text/javascript" src="public/js/owl.carousel.min.js"></script>
<script src="public/js/layui/layui.js"></script>
<script type="text/javascript">
    layui.use('laypage', function(){
        var laypage = layui.laypage;

        //完整功能
        laypage.render({
            elem: 'demo7'
            ,count: "<?=$num?>"*10
            ,layout: ['prev', 'page', 'next', 'skip']
            ,curr: <?=$p?> //获取起始页
            ,jump: function(obj,first){
                var id = "<?=$id?>";
                if(!first){
                    location.href = '<?php echo base_url()?>order/approve_order?p=' + obj.curr + '&id=' + id;
                }
            }
        });

    });

    $(function () {
        $(".send-again").click(function(){
            $(".block").css('display','block');
            $(".mask,.pop-account-activation").show();
        });
    });
    
    $('.modify-order').click(function () {
        var id = $(this).attr('val');
        $.ajax({
            type: "POST",
            url: "<?php echo base_url()?>order/modify",
            data: {id:id},
            dataType: "json",
            success: function(data){
                if(data.code==0){
                    location.href = '<?php echo base_url()?>cart/index';
                }else{
                    layer.msg('操作失败');
                }
            }
        });
    })

    $('.preurl').click(function () {
        var preurl = "<?=$preurl?>"
        location.href = preurl;
    })

    $('.nexturl').click(function () {
        var nexturl = "<?=$nexturl?>"
        location.href = nexturl;
    })
</script>

</body>
</html>